var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2BundleManager = require("BundleManager");
var $2UIManager = require("UIManager");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_ToastUI = /* */function (_cc$Component75) {
  babel_inherits(r, _cc$Component75);
  var _super91 = babel_createSuper(r);
  function r() {
    var _this211;
    babel_classCallCheck(this, r);
    _this211 = _super91.apply(this, arguments);
    _this211.layout = null;
    return _this211;
  }
  babel_createClass(r, [{
    key: "showToast",
    value: function showToast(e) {
      var t = cc.instantiate($2BundleManager.default.instance.getBundleRes("Prefab", "Object/Toast", cc.Prefab));
      this.node.getChildByName("Layout").addChild(t);
      t.getChildByName("label").getComponent(cc.Label).string = e;
      t.opacity = 0;
      cc.tween(t).to(.25, {
        opacity: 255
      }).delay(1.5).to(.25, {
        opacity: 0
      }).call(function () {
        return t.destroy();
      }).start();
    }
  }, {
    key: "update",
    value: function update(e) {
      0 == this.layout.childrenCount && $2UIManager.default.instance.closeUI("ToastUI");
    }
  }]);
  return r;
}(cc.Component);
cc__decorate([ccp_property(cc.Node)], def_ToastUI.prototype, "layout", undefined);
def_ToastUI = cc__decorate([ccp_ccclass], def_ToastUI);
exports.default = def_ToastUI;